Skip to content

Update README and API to support city/country queries#205

Merged
cloneofghosts merged 4 commits into
masterfrom
update-docs
Jun 13, 2026
Merged

Update README and API to support city/country queries#205
cloneofghosts merged 4 commits into
masterfrom
update-docs

Conversation

@cloneofghosts

@cloneofghosts cloneofghosts commented Jun 13, 2026

Copy link
Copy Markdown
Owner

With version 2.9.6 the API now supports queries using a city,country pair so the documentation/API has been updated to clarify that it can be used.

Fixes #201

Summary by CodeRabbit

  • New Features

    • Forecast queries can now accept a city name + country code in place of numeric latitude/longitude for location lookups.
  • Documentation

    • README and API docs updated to show location parameters accept coordinates or city/country identifiers.
    • Flags documentation updated: nearestStation now described as distance to closest MOSMIX station (or -999 when none).

@cloneofghosts cloneofghosts added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 13, 2026
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 212811d7-f597-4f27-a58b-e99e12a9da34

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

The PR documents support for querying load_forecast using city name and country code instead of coordinates. Parameter documentation is updated in the API docstring and README, a code example is added, a new test validates the capability, and existing test expectations are adjusted. The package version is bumped to 1.3.2.

Changes

City/Country Parameter Support

Layer / File(s) Summary
API parameter documentation
pirateweather/api.py, README.md
The inLat/inLong parameters now document that they accept latitude/longitude coordinates or city/country identifiers instead of coordinates alone.
Usage example documentation
README.md
A new code example demonstrates calling load_forecast with city name ("London") and country code ("GB") parameters.
Test coverage for city/country lookup
tests/test_pirateweather.py
A new test method test_with_city_name validates that load_forecast accepts city and country arguments and receives a successful response. Test assertions in test_flags are updated to match the current API response values for sources, sourceTimes, and nearestStation.
Version update
setup.py
Package version is incremented from 1.3.1 to 1.3.2.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating README and API documentation to support city/country query format.
Linked Issues check ✅ Passed The PR addresses issue #201 by updating documentation and API docstrings to clarify city/country query support, matching the API's capability added in version 2.9.6.
Out of Scope Changes check ✅ Passed The version bump to 1.3.2 is a minor scope expansion but appropriate for documenting a user-facing feature update; all changes align with supporting city/country queries.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch update-docs

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

188-189: ⚠️ Potential issue | 🟠 Major

Update nearestStation documentation to match actual behavior

README.md claims nearestStation is “Not implemented, and will always return 0” (README.md#L188-L189), but PirateWeatherFlagsBlock.nearestStation is populated from the API payload field nearest-station (pirateweather/models.py#L104-L119) and the test expects a non-zero value (tests/test_pirateweather.py#L133-L135). Update the README to reflect that nearestStation mirrors the API response (and document what happens when the field is missing), and align the test/contract accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 188 - 189, README.md (lines 188-189): update the
nearestStation bullet to state that nearestStation is populated from the API
field "nearest-station" (via PirateWeatherFlagsBlock.nearestStation) and that it
mirrors the API value or is null/0/absent when the API omits the field (choose
the exact missing-field behavior described by PirateWeatherFlagsBlock
implementation). tests/test_pirateweather.py (lines 133-135): ensure the test
assertion matches the documented/implemented behavior of
PirateWeatherFlagsBlock.nearestStation (either assert non-zero when the fixture
includes "nearest-station" or assert null/0/absent when the fixture omits it);
adjust the test expectation to match the implementation rather than the old
README claim. Also verify PirateWeatherFlagsBlock.nearestStation
(pirateweather/models.py) handling of missing "nearest-station" is reflected in
both README and test (no code change required if behavior is already correct).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@README.md`:
- Around line 188-189: README.md (lines 188-189): update the nearestStation
bullet to state that nearestStation is populated from the API field
"nearest-station" (via PirateWeatherFlagsBlock.nearestStation) and that it
mirrors the API value or is null/0/absent when the API omits the field (choose
the exact missing-field behavior described by PirateWeatherFlagsBlock
implementation). tests/test_pirateweather.py (lines 133-135): ensure the test
assertion matches the documented/implemented behavior of
PirateWeatherFlagsBlock.nearestStation (either assert non-zero when the fixture
includes "nearest-station" or assert null/0/absent when the fixture omits it);
adjust the test expectation to match the implementation rather than the old
README claim. Also verify PirateWeatherFlagsBlock.nearestStation
(pirateweather/models.py) handling of missing "nearest-station" is reflected in
both README and test (no code change required if behavior is already correct).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87f94bca-6d41-4ef7-b469-2237a1984a26

📥 Commits

Reviewing files that changed from the base of the PR and between ae5ed8a and c544a9d.

📒 Files selected for processing (4)
  • README.md
  • pirateweather/api.py
  • setup.py
  • tests/test_pirateweather.py

@cloneofghosts cloneofghosts merged commit 5e72f19 into master Jun 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support latest features

1 participant